package com.example.leetdemo.process;

public class Solution2444 {

    public long countSubarrays(int[] nums, int minK, int maxK) {
        int l = 0, v = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == minK) {
                l++;
            }
            if (nums[i] == maxK) {
                v += l;
            }
        }
        return v;
    }

    // 子数组
}
